
local total = achievements.GetValue( "Heavy Lifting", "total", 0 )
local pickedUp = {}

local function PhysgunPickup( ply, ent )
	if ( pickedUp[ ent ] ) then return end
	
	if ( total != 20 && ply == LocalPlayer() && ent:GetClass() == "prop_physics" ) then
		total = math.Clamp( total + 1, 0, 20 )
		achievements.Update( "Heavy Lifting", total / 20, total .. "/20" )
		achievements.SetValue( "Heavy Lifting", "total", total )
		
		pickedUp[ ent ] = true
	end
end
hook.Add( "PhysgunPickup", "Achievements.HeavyLifting", PhysgunPickup )

achievements.Register( "Heavy Lifting", "Pick up a total of 20 different props with the physics gun, in multiplayer.", "achievements/heavylifting", total / 20, total .. "/20" )